/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.kallsonys.object;

import java.io.Serializable;
import java.math.BigDecimal;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author allan
 */
@Entity
@Table(name = "CAREGORY")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Caregory.findAll", query = "SELECT c FROM Caregory c"),
    @NamedQuery(name = "Caregory.findByCategoryid", query = "SELECT c FROM Caregory c WHERE c.categoryid = :categoryid"),
    @NamedQuery(name = "Caregory.findByCategorydescription", query = "SELECT c FROM Caregory c WHERE c.categorydescription = :categorydescription")})
public class Caregory implements Serializable {
    private static final long serialVersionUID = 1L;
    // @Max(value=?)  @Min(value=?)//if you know range of your decimal fields consider using these annotations to enforce field validation
    @Id
    @Basic(optional = false)
    @NotNull
    @Column(name = "CATEGORYID")
    private BigDecimal categoryid;
    @Size(max = 200)
    @Column(name = "CATEGORYDESCRIPTION")
    private String categorydescription;

    public Caregory() {
    }

    public Caregory(BigDecimal categoryid) {
        this.categoryid = categoryid;
    }

    public BigDecimal getCategoryid() {
        return categoryid;
    }

    public void setCategoryid(BigDecimal categoryid) {
        this.categoryid = categoryid;
    }

    public String getCategorydescription() {
        return categorydescription;
    }

    public void setCategorydescription(String categorydescription) {
        this.categorydescription = categorydescription;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (categoryid != null ? categoryid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Caregory)) {
            return false;
        }
        Caregory other = (Caregory) object;
        if ((this.categoryid == null && other.categoryid != null) || (this.categoryid != null && !this.categoryid.equals(other.categoryid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return categorydescription;
    }
    
}
